package com.djq.project.mq.producer.rpc;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SendRpc {
    public static final String RPC_QUEUE_NAME = "rpc_queue";
    @Autowired
    RabbitTemplate rabbitTemplate;
    @RequestMapping("/sendRpc")
    public String sendRpc(String msg){
        Object o = rabbitTemplate.convertSendAndReceive(RPC_QUEUE_NAME, msg);
        return (String )o;
    }

}
